package cn.bb.bbstudy.controller;

import cn.bb.bbstudy.pojo.Download;
import cn.bb.bbstudy.service.DownloadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class DownloadController {

    @Autowired
    private DownloadService downloadService;

    @GetMapping("download")
    public String download(Model model) {
        List<Download> downloadList = downloadService.selectAllDesc();
        model.addAttribute("downloadList", downloadList);
        return "page/download";
    }
}
